{extend name="common:base"/}
{block name="body"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-12">
        <h2>系统设置</h2>
    </div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{present name="info"}编辑{else /}新增{/present}导航</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i> 
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content p-xl-important">
                    <form class="form-horizontal" id="signupForm" method="post" action="{:\\think\\Url::build('renew')}" >
                        <div class="form-group ">
                            <label class=" control-label">标题<span class="check-tips">（用于显示的文字）</span></label>
                            <input id="title" class="form-control input-large" type="text" name="title" value="{$info.title|default=''}">
                        </div>
                        <div class="form-group">
                            <label class=" control-label">链接<span class="check-tips">(用于调转的URL，支持带http://的URL或U函数参数格式)</span></label>
                            <input id="url" class="form-control  input-large" type="text" name="url" value="{$info.url|default=''}">
                        </div>
                        <div class="form-group input-large">
                            <label class="control-label">新窗口打开<span class="check-tips">(是否新窗口打开链接)</span></label>
                            <select class="form-control input-small" name="target">
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label class=" control-label">优先级<span class="check-tips">(导航显示顺序)</span></label>
                            <input  class="form-control input-small" type="text" name="sort" value="{$info.sort|default=0}">
                        </div>
                        <div class="form-group">
                            <input type="hidden" name="id" value="{$info.id|default=''}">
                            <input type="hidden" name="pid" value="{$pid|default=0}">
                            <button class="btn btn-w-m btn-primary" target-form="form-horizontal" type="submit">提交</button>
                            <button class="btn btn-w-m btn-default retreat">取消</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
{/block}
{block name="script"}
<!-- 选择js 加载-->
<script type="text/javascript" src="__JS__/detail.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script type="text/javascript">
    $(function () {
        highlight_subnav("{:\\think\\Url::build('Channel/index')}");
        static7.setChoose("target", "{$info.target|default=0}");
        $("#signupForm").validate({
            rules: {
                title: {
                    required: true,
                    minlength: 2
                },
                url: "required"
            },
            messages: {
                title: {
                    required: '标题不能为空',
                    minlength: '至少两个字符以上'
                },
                url: {
                    required: "链接不能为空"
                }
            },
            submitHandler: function () {
                validateAjax("#signupForm", "button[type='submit']");
                return false;
            }
        });
    });
</script>
{/block}